var e = require;
var t = module;
var o = exports;
Object.defineProperty(o, "__esModule", {value: !0});
var n = e("BaseModuleUI"),
    a = e("NotifyEventType"),
    i = e("GlobalParams"),
    r = e("AssetsManager"),
    s = e("RoleSoldierInfo"),
    l = cc._decorator,
    c = l.ccclass,
    d = l.property,
    h = (function (e) {
        function t() {
            var t = (null !== e && e.apply(this, arguments)) || this;
            return (
                (t.red_bg = null),
                (t.blue_bg = null),
                (t.green_bg = null),
                (t.head_sprite = null),
                (t.head_index = 0),
                t
            );
        }
        return (
            __extends(t, e),
            (t.prototype.addEvent = function () {
                this.attachEvent(a.default.SEND_ROLE_SMALL_HEAD_POS, this.showRoleHeadPos, this),
                    this.attachEvent(a.default.SEND_ROLE_BE_KILL_INFO, this.showRoleBeKill, this);
            }),
            (t.prototype.showHeadInfo = function (e) {
                (this.head_index = e),
                    (this.red_bg.active = e % 2 != 0),
                    (this.blue_bg.active = e % 2 == 0),
                    (this.green_bg.active = e == i.GlobalParams.MatchMyIndex);
                var t = i.GlobalParams.MatchGamePlayer[e];
                this.head_sprite.spriteFrame = r.default
                    .getInstance()
                    .getHeroHeadFrame(s.default.Role_info[t.role_id].C_ID);
            }),
            (t.prototype.showRoleHeadPos = function (e, t) {
                var o = t;
                if (o.index == this.head_index) {
                    this.node.opacity = 255;
                    var n = o.pos;
                    ((n = cc.v2(n.x / 14, n.y / 14)).y += 10), this.node.setPosition(n);
                }
            }),
            (t.prototype.showRoleBeKill = function (e, t) {
                t.be_kill == this.head_index && (this.node.opacity = 0);
            }),
            __decorate([d(cc.Node)], t.prototype, "red_bg", void 0),
            __decorate([d(cc.Node)], t.prototype, "blue_bg", void 0),
            __decorate([d(cc.Node)], t.prototype, "green_bg", void 0),
            __decorate([d(cc.Sprite)], t.prototype, "head_sprite", void 0),
            __decorate([c], t)
        );
    })(n.default);
o.default = h;
